package com.xuecheng.teaching.agent;


import com.xuecheng.api.content.model.dto.CoursePubDTO;
import com.xuecheng.common.constant.XcFeignServiceNameList;
import com.xuecheng.common.domain.response.RestResponse;
import com.xuecheng.teaching.agent.hystrix.ContentApiAgentFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.Set;

/**
 * Created on 2021/04/05/19:43 周一
 *
 * @author Lantin
 */

@FeignClient(value = XcFeignServiceNameList.XC_CONTENT_SERVICE, fallbackFactory = ContentApiAgentFallbackFactory.class)
public interface ContentApiAgent {

    @GetMapping("content/l/teachplan/work/{workId}")
    RestResponse<Integer> getTeachplanWorkCountById(@PathVariable Long workId);

    /**
     * <p>
     * 根据作业id查询绑定了作业的课程名称
     * </p>
     *
     * @param workId 作业id
     * @return RestResponse<List < String>>
     */
    @GetMapping("content/l/teachplan/association/{workId}")
    RestResponse<Set<String>> getWorkAssociationPlanName(@PathVariable Long workId);



    /**
     * 根据课程发布id 获取课程发布对象信息
     * @param coursePubId
     * @return
     */
    @GetMapping("content/l/coursePub/{coursePubId}")
    RestResponse<CoursePubDTO> getCoursePubById(@PathVariable(value = "coursePubId") Long coursePubId);
}
